<!-- 国资委初审表 -->
<template>
  <div class="fcontainer">
    <el-table
      :data="tableData"
      :show-header="false"
      :span-method="objectSpanMethod"
      border
      :row-class-name="getRowClassName"
      :cell-style="{ borderColor: '#bbb' }"
      :header-cell-style="{ borderColor: '#bbb' }"
      style="width: 80%; --el-table-border-color: #bbb"
    >
      <el-table-column
        class-name="one-index"
        prop="oneIndex"
        label=""
        align="center"
      />
      <el-table-column
        class-name="two-index"
        prop="twoIndex"
        label=""
        align="center"
      />
      <el-table-column
        class-name="three-index"
        prop="threeIndex"
        label=""
        align="center"
      />
      <el-table-column
        class-name="four-index"
        prop="fourIndex"
        label=""
        align="center"
      />
      <el-table-column
        class-name="five-index"
        prop="fiveIndex"
        label=""
        align="center"
      />
    </el-table>
  </div>
</template>
<script setup name="sureTemplate">
const getRowClassName = ({ row, rowIndex }) => {
  // 这里可以访问到行数据 row 和行索引 rowIndex
  console.log("---8899---");
  console.log(row, rowIndex);
  if (rowIndex === 2) {
    return "add-background";
  }
  if (rowIndex > 2) {
    return "delete-background";
  }
  return "";
};
const tableData = ref([
  {
    oneIndex: "委托单位",
    twoIndex: "北京能源投资(集团)有限公司",
    threeIndex: "",
    fourIndex: "评估对象",
    fiveIndex: "北京能源投资(集团)有限公司",
  },
  {
    oneIndex: "评估机构",
    twoIndex: "中资资产评估有限公司",
    threeIndex: "",
    fourIndex: "审计机构",
    fiveIndex: "XXX",
  },
  {
    oneIndex: "序号",
    twoIndex: "评价内容",
    threeIndex: "",
    fourIndex: "评价结果",
    fiveIndex: "",
  },
  {
    oneIndex: "1.审计报告",
    twoIndex: "专项审计报告格式和内容符合相关规定的情况",
    threeIndex: "",
    fourIndex: "优",
    fiveIndex: "",
  },
  {
    oneIndex: "",
    twoIndex: "专项审计目的明确，审计目的与经济行为一致",
    threeIndex: "",
    fourIndex: "优",
    fiveIndex: "",
  },
  {
    oneIndex: "",
    twoIndex: "提供完整调整事项分录、审计事项说明和试算平衡表",
    threeIndex: "",
    fourIndex: "优",
    fiveIndex: "",
  },
  {
    oneIndex: "",
    twoIndex: "应当调整而未调整的事项在审计报告中披露情况",
    threeIndex: "",
    fourIndex: "优",
    fiveIndex: "",
  },
  {
    oneIndex: "2.评估报告	",
    twoIndex: "评估报告内容格式符合评估指南的要求",
    threeIndex: "",
    fourIndex: "优",
    fiveIndex: "",
  },
  {
    oneIndex: "",
    twoIndex: "评估目的表述准",
    threeIndex: "",
    fourIndex: "优",
    fiveIndex: "",
  },
  {
    oneIndex: "",
    twoIndex: "评估范围与经济行为批准文件确定的资产范围一致",
    threeIndex: "",
    fourIndex: "优",
    fiveIndex: "",
  },
  {
    oneIndex: "",
    twoIndex: "评估基准日的选择适当",
    threeIndex: "",
    fourIndex: "优",
    fiveIndex: "",
  },
  {
    oneIndex: "",
    twoIndex:
      "评估参数的选取科学、评估依据充分、评估假设合理、选取的价值类型和评估方法适当",
    threeIndex: "",
    fourIndex: "优",
    fiveIndex: "",
  },
  {
    oneIndex: "",
    twoIndex: "可能影响评估结果的特别事项充分披露",
    threeIndex: "",
    fourIndex: "优",
    fiveIndex: "",
  },
  {
    oneIndex: "",
    twoIndex: "评估说明评估对象进行了充分、适当的阐述",
    threeIndex: "",
    fourIndex: "优",
    fiveIndex: "",
  },
  {
    oneIndex: "",
    twoIndex: "评估结果选取依据充分",
    threeIndex: "",
    fourIndex: "优",
    fiveIndex: "",
  },
  {
    oneIndex: "",
    twoIndex: "评估结果增减值原因分析充分、合理",
    threeIndex: "",
    fourIndex: "优",
    fiveIndex: "",
  },
  {
    oneIndex: "",
    twoIndex: "报告附件完整、齐备",
    threeIndex: "",
    fourIndex: "中",
    fiveIndex: "",
  },
]);
const objectSpanMethod = ({ rowIndex, columnIndex }) => {
  // rowIndex, // 行索引  columnIndex, // 列索引
  if (columnIndex == 0) {
    if (rowIndex === 3) {
      return {
        rowspan: 4,
        colspan: 1,
      };
    }
    if (rowIndex === 7) {
      return {
        rowspan: 10,
        colspan: 1,
      };
    }
    if (
      rowIndex === 4 ||
      rowIndex === 5 ||
      rowIndex === 6 ||
      rowIndex === 8 ||
      rowIndex === 9 ||
      rowIndex === 10 ||
      rowIndex === 11 ||
      rowIndex === 12 ||
      rowIndex === 13 ||
      rowIndex === 14 ||
      rowIndex === 15 ||
      rowIndex === 16
    ) {
      return {
        rowspan: 0,
        colspan: 0,
      };
    }
  } else if (columnIndex == 1) {
    if (
      rowIndex === 0 ||
      rowIndex === 1 ||
      rowIndex === 2 ||
      rowIndex === 3 ||
      rowIndex === 4 ||
      rowIndex === 5 ||
      rowIndex === 6 ||
      rowIndex === 7 ||
      rowIndex === 8 ||
      rowIndex === 9 ||
      rowIndex === 10 ||
      rowIndex === 11 ||
      rowIndex === 12 ||
      rowIndex === 13 ||
      rowIndex === 14 ||
      rowIndex === 15 ||
      rowIndex === 16
    ) {
      return {
        rowspan: 1,
        colspan: 2,
      };
    } else {
      return {
        rowspan: 1,
        colspan: 1,
      };
    }
  } else if (columnIndex == 2) {
    if (
      rowIndex === 0 ||
      rowIndex === 1 ||
      rowIndex === 2 ||
      rowIndex === 3 ||
      rowIndex === 4 ||
      rowIndex === 5 ||
      rowIndex === 6 ||
      rowIndex === 7 ||
      rowIndex === 8 ||
      rowIndex === 9 ||
      rowIndex === 10 ||
      rowIndex === 11 ||
      rowIndex === 12 ||
      rowIndex === 13 ||
      rowIndex === 14 ||
      rowIndex === 15 ||
      rowIndex === 16
    ) {
      return {
        rowspan: 0,
        colspan: 0,
      };
    }
  } else if (columnIndex == 3) {
    if (rowIndex === 0 || rowIndex === 1) {
      return {
        rowspan: 1,
        colspan: 1,
      };
    }
    if (
      rowIndex === 2 ||
      rowIndex === 3 ||
      rowIndex === 4 ||
      rowIndex === 5 ||
      rowIndex === 6 ||
      rowIndex === 7 ||
      rowIndex === 8 ||
      rowIndex === 9 ||
      rowIndex === 10 ||
      rowIndex === 11 ||
      rowIndex === 12 ||
      rowIndex === 13 ||
      rowIndex === 14 ||
      rowIndex === 15 ||
      rowIndex === 16
    ) {
      return {
        rowspan: 1,
        colspan: 2,
      };
    }
  } else if (columnIndex == 4) {
    if (rowIndex === 0 || rowIndex === 1 || rowIndex === 2) {
      return {
        rowspan: 1,
        colspan: 1,
      };
    }
    if (
      rowIndex === 3 ||
      rowIndex === 4 ||
      rowIndex === 5 ||
      rowIndex === 6 ||
      rowIndex === 7 ||
      rowIndex === 8 ||
      rowIndex === 9 ||
      rowIndex === 10 ||
      rowIndex === 11 ||
      rowIndex === 12 ||
      rowIndex === 13 ||
      rowIndex === 13 ||
      rowIndex === 14 ||
      rowIndex === 15 ||
      rowIndex === 16
    ) {
      return {
        rowspan: 0,
        colspan: 0,
      };
    }
  } else {
    return {
      rowspan: 1,
      colspan: 1,
    };
  }
};
</script>

<style scoped lang="scss">
.fcontainer {
  :deep(.el-table) {
    .add-background {
      font-weight: bold;
      background-color: #e4f6fd;
    }
    .delete-background .four-index {
      background: transparent !important;
      font-weight: normal !important;
    }
    .one-index {
      background-color: #e4f6fd;
      font-weight: bold;
    }
    .four-index {
      background-color: #e4f6fd;
      font-weight: bold;
    }
    .el-table__body-wrapper {
      border-color: #bbb !important; /* 例如：#f00（红色） */
    }
    .el-table__header-wrapper {
      border-color: #bbb !important; /* 例如：#f00（红色） */
    }
  }
}
</style>

